//
//  HMShopViewController.m
//  G05爱鲜蜂
//
//  Created by 曹魏 on 16/10/20.
//  Copyright © 2016年 何源. All rights reserved.
//

#import "StrollViewController.h"
#import "Masonry.h"
#import "HMMainViewController.h"
#import "HMTableFootView.h"

@interface StrollViewController ()
@property (nonatomic,weak) UIImageView  *shopImageView;
@property (nonatomic,weak) UILabel  *shopLable;
@property (nonatomic,weak) UIButton  *shopBtn;


@end

@implementation StrollViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self setupUI];
    
}

-(void)setupUI {
    
    UIImageView *shopImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"v2_shop_empty"]];
    self.shopImageView = shopImageView;
    [self.view addSubview:self.shopImageView];
    
    [shopImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.centerY.equalTo(self.view).offset(-50);
        
    }];
    
    UILabel *shopLable = [[UILabel alloc]init];
    self.shopLable = shopLable;
    shopLable.text = @"亲,购物车空空的,赶紧挑点好吃的";
    [self.view addSubview:shopLable];
    
    [shopLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.equalTo(self.shopImageView.mas_bottom).offset(10);
        
    }];
    
    
    UIButton *shopBtn = [[UIButton alloc]init];
    self.shopBtn = shopBtn;
    shopBtn.titleLabel.text = @"去逛逛";
    //[shopBtn setTitle:@"去逛逛" forState:UIControlStateNormal];
    shopBtn.titleLabel.font = [UIFont systemFontOfSize:15];
    [shopBtn setTintColor:[UIColor redColor]];
    [shopBtn setBackgroundImage:[UIImage imageNamed:@"btn.png"] forState:UIControlStateNormal];
    
    [shopBtn addTarget:self action:@selector(shopBtnDidClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:shopBtn];
    
    [shopBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.equalTo(self.shopLable.mas_bottom).offset(10);
        make.width.equalTo(@200);
        make.height.equalTo(@40);
    }];
}


-(void)shopBtnDidClick {
    HMMainViewController *mainVC = [[HMMainViewController alloc]init];
    [self.navigationController pushViewController:mainVC animated:YES];
}

@end
